-- GENERATED SPELL FOR [Mal'druk the Soulrender] --


function spell0_20445(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(16568,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20445', 3000, 1)
end

function spell1_20445(pUnit, Event) --@Shadowfury,n/a--
pUnit:FullCastSpellOnTarget(35373,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20445', 3000, 1)
end

function spell2_20445(pUnit, Event) --@Summon Shadow Image,n/a--
pUnit:FullCastSpellOnTarget(35425,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20445', 561, 1)
end

function Sorts_20445(pUnit, Event)
local choix_sorts_20445 = math.random(0, 2)
if choix_sorts_20445 == 0 then
pUnit:RegisterEvent('spell0_20445', 1, 1)
end
if choix_sorts_20445 == 1 then
pUnit:RegisterEvent('spell1_20445', 1, 1)
end
if choix_sorts_20445 == 2 then
pUnit:RegisterEvent('spell2_20445', 1, 1)
end
end

function mob20445_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20445', math.random(1500, 3000), 1)
end

function mob20445_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20445_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20445_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20445, 1, 'mob20445_Action')
RegisterUnitEvent(20445, 2, 'mob20445_Leave')
RegisterUnitEvent(20445, 3, 'mob20445_Kill')
RegisterUnitEvent(20445, 4, 'mob20445_Die')
